<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body style="font-family:Arial, Helvetica, sans-serif; font-size:13px;">
<form action="" method="post">
<?php foreach($this->arrRes  as $key => $v){
echo "<h1>{$key}</h1>";	
?>
<table width="1100" border="1" cellspacing="0" cellpadding="10">
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Barcode</th>
    <th scope="col">Des</th>
    <th scope="col">Adjustment</th>
    <th scope="col">Order</th>
    <th scope="col">Freezed</th>
    <th scope="col">Adj Action</th>
    <th scope="col" style="width:150px;">Order Action</th>
  </tr>
<?php 
if(!empty($v)){

foreach($v as $item){?>  
  <tr>
    <td><?php echo $item['id_adjust']?></td>
    <td><?php echo $item['code_product']?></td>
    <td><?php $des = Model_System_Downloadhelper::downloadUrl('http://'.SERVER_IP_COMM.'/products/get-old-apos-product-description/barcode/'.strtoupper($item['code_product']));

	
	if(strpos($des,"Item Description Not Available")!==false){
		echo "<span style=\"color:#900;\">{$des}</span>";	
		}
	else{
		
		echo $des;
	}	
	
	
	
	?></td>
    <td><?php echo $item['qty_adjust']?></td>
    <td><?php echo $item['qty_order']?></td>
    <td><?php echo $item['date_freeze']?></td>
    <td><?php 
	if(strtoupper(substr($item['no_ka'],0,2)) == "KA"){
		echo "<span style=\"color:#091;\">Done</span>";
		}
	if($item['qty_adjust'] == 0){
		echo "-";
		}
	if($item['qty_adjust'] != 0 && strtoupper(substr($item['no_ka'],0,4)) == "TMPA" ){
		echo "<span style=\"color:#900;\">DoIt Now</span>";
		}		
	?></td>
    <td>
    <?php
    if($item['qty_order'] ==0 ){
		echo "-";
		}
	if($item['qty_order'] >0 && strtoupper(substr($item['no_order'],0,3)) == "DIS"){
		echo "<span style=\"color:#900;\">DISCONTINUED</span>";
		}	
	if($item['qty_order'] >0 && strtoupper(substr($item['no_order'],0,2)) == "KT"){
		echo "<span style=\"color:#091;\">Done</span>";
		}
	if($item['qty_order'] >0 && strtoupper(substr($item['no_order'],0,4)) == "BACK"){
		echo "<span style=\"color:#091;\">BACK ORDERED</span>";
		}		
	if($item['qty_order'] >0 && strtoupper(substr($item['no_order'],0,2)) == "PD"){
	?>
	<input name="choice[<?php echo $item['id_adjust']?>]" type="radio" value="1|<?php echo $item['code_product']?>" /> 
	[STOP]
	<input name="choice[<?php echo $item['id_adjust']?>]" type="radio" value="2|<?php echo $item['code_product']?>" /> 
	[LATR]
	<?php
		}			
	
	?>
    </td>
  </tr>
<?php }

}
?>  
</table>
<?php }?>
<br />
<br />
<input name="submit" type="submit" id="submit" value="submit" />
</form>
</body>
</html>
